const app = getApp()
const util=require('../../utils/util.js')//导入util.js文件

Page({
  data: {
    active: 0,
  },
  onLoad() {
    this.setData(this.data)
  },
  buy(e) {
    if(e.currentTarget.dataset.name == 'one') {
      this.data.price = 10
    }
    if(e.currentTarget.dataset.name == 'two') {
      this.data.price = 25
    }
    if(e.currentTarget.dataset.name == 'three') {
      this.data.price = 120
    }
    if(e.currentTarget.dataset.name == 'four') {
      this.data.price = 600
    }
    this.setData(this.data)
  },
  onChange(e) {
    wx.showToast({
      title: '${e.detail.name}',
    })
  },
  changeToPay(e) {
    util.redirect({
      url: 'pay'
    })
  },
  sctrain(e) {
    util.redirect({
      url: 'sctrain',
    })
  },
  title(e) {
    util.redirect({
      url: 'title',
    })
  },
});
